<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>links</title>
</head>

<body>
<?
require_once '../inc.php';
$filename=$_REQUEST['filename'];
 
 
class Singleton {

    private static $instance=null;
    private $value=null;

    private function __construct($value) {
        $this->value = $value;
    }

    public static function getInstance() {
        if ( self::$instance == null ) {
            echo "<br>new<br>";
            self::$instance = new Singleton("values");
        }  
		else {
            echo "<br>old<br>";
        }
        return self::$instance;
    }

}

$x = Singleton::getInstance();
var_dump($x); // returns the new object
$y = Singleton::getInstance();
var_dump($y); // returns the existing object
?>
 
</body>
</html>